package com.aspose.cells;

class zaqw {
   private zapy a;
   private Workbook b;
   private zcfw c;
   private static final com.aspose.cells.b.c.a.za d = new com.aspose.cells.b.c.a.za(new String[]{"config-item-set", "name", "view-settings", "config-item", "config-item-map-indexed", "config-item-map-named", "config-item-map-entry", "type", "HorizontalSplitMode", "VerticalSplitMode", "CursorPositionX", "CursorPositionY", "ActiveSplitRange", "HorizontalSplitPosition", "VerticalSplitPosition", "PositionLeft", "PositionRight", "PositionTop", "PositionBottom", "ZoomType", "ZoomValue", "PageViewZoomValue", "ShowGrid", "ShowZeroValues", "AutoCalculate", "VisibleAreaTop", "VisibleAreaLeft", "VisibleAreaWidth", "VisibleAreaHeight", "ActiveTable", "VerticalScrollbarWidth", "HorizontalScrollbarWidth", "GridColor", "HasSheetTabs", "HasColumnRowHeaders", "IsOutlineSymbolsSet"});

   zaqw(zapy var1) {
      this.a = var1;
      this.b = this.a.b;
   }

   void a(com.aspose.cells.a.f.zi var1) throws Exception {
      zhu.c();
      if (var1.a("settings.xml", true) != -1) {
         this.c = zasr.a(var1, "settings.xml", false);
         if (this.c.n()) {
            this.c.a();
         } else {
            for(int var2 = 0; var2 < 3; ++var2) {
               this.c.d();
               if (!zass.a(this.c)) {
                  return;
               }
            }

            switch(d.a(this.c.p().toLowerCase())) {
            case 0:
               String var3 = null;
               if (this.c.m()) {
                  while(this.c.l()) {
                     switch(d.a(this.c.p())) {
                     case 1:
                        var3 = this.c.s();
                     }
                  }

                  this.c.k();
               }

               if (var3 == null) {
                  this.c.a();
               } else {
                  if (var3.startsWith("ooo:")) {
                     var3 = var3.substring(4);
                  }

                  switch(d.a(var3)) {
                  case 2:
                     this.a();
                     return;
                  default:
                     this.c.a();
                  }
               }
               break;
            default:
               this.c.a();
            }

         }
      }
   }

   private void a() throws Exception {
      if (this.c.n()) {
         this.c.a();
      } else {
         this.c.d();

         while(zass.a(this.c)) {
            switch(d.a(this.c.p())) {
            case 3:
               this.e();
               break;
            case 4:
               this.b();
               break;
            default:
               this.c.a();
            }
         }

      }
   }

   private void b() throws Exception {
      boolean var1 = false;
      if (this.c.m()) {
         while(true) {
            if (!this.c.l()) {
               this.c.k();
               break;
            }

            switch(d.a(this.c.p())) {
            case 1:
               var1 = "Views".equals(this.c.s());
            }
         }
      }

      if (var1 && !this.c.n()) {
         this.c.d();
         if (zass.a(this.c)) {
            if (!"config-item-map-entry".equals(this.c.p())) {
               this.c.a();
               this.c.h();
            } else {
               this.c.d();

               while(zass.a(this.c)) {
                  switch(d.a(this.c.p())) {
                  case 3:
                     this.e();
                     break;
                  case 5:
                     this.c();
                     break;
                  default:
                     this.c.a();
                  }
               }

            }
         }
      } else {
         this.c.a();
      }
   }

   private void c() throws Exception {
      if (this.c.n()) {
         this.c.a();
      } else {
         this.c.d();

         while(zass.a(this.c)) {
            switch(d.a(this.c.p())) {
            case 6:
               this.d();
               break;
            default:
               this.c.a();
            }
         }

      }
   }

   private void d() throws Exception {
      Worksheet var1 = null;
      if (this.c.m()) {
         while(true) {
            if (!this.c.l()) {
               this.c.k();
               break;
            }

            switch(d.a(this.c.p().toLowerCase())) {
            case 1:
               var1 = this.b.getWorksheets().get(this.c.s());
            }
         }
      }

      if (this.c.n()) {
         this.c.a();
      } else {
         String var2 = null;
         String var3 = null;
         String var4 = null;
         int var5 = 0;
         int var6 = 0;
         int var7 = 0;
         int var8 = 0;
         int var9 = 0;
         int var10 = 0;
         int var11 = 2;
         int var12 = 0;
         int var13 = 100;
         int var14 = 60;
         int var15 = 0;
         int var16 = 0;
         byte var17 = 0;
         int var18 = 0;
         int var19 = -1;
         this.c.d();

         while(zass.a(this.c)) {
            if (this.c.n()) {
               this.c.a();
               return;
            }

            switch(d.a(this.c.p())) {
            case 3:
               if (this.c.m()) {
                  while(this.c.l()) {
                     switch(d.a(this.c.p().toLowerCase())) {
                     case 1:
                        var2 = this.c.s();
                        break;
                     case 7:
                        var4 = this.c.s();
                     }
                  }

                  this.c.k();
               }

               var3 = this.c.i();
               switch(d.a(var2)) {
               case 8:
                  var8 = com.aspose.cells.b.a.zo.a(var3);
                  continue;
               case 9:
                  var7 = com.aspose.cells.b.a.zo.a(var3);
                  continue;
               case 10:
                  var5 = com.aspose.cells.b.a.zo.a(var3);
                  continue;
               case 11:
                  var6 = com.aspose.cells.b.a.zo.a(var3);
                  continue;
               case 12:
                  var11 = com.aspose.cells.b.a.zo.a(var3);
                  continue;
               case 13:
                  var10 = com.aspose.cells.b.a.zo.a(var3);
                  continue;
               case 14:
                  var9 = com.aspose.cells.b.a.zo.a(var3);
                  continue;
               case 15:
                  var15 = com.aspose.cells.b.a.zo.a(var3);
                  continue;
               case 16:
                  var16 = com.aspose.cells.b.a.zo.a(var3);
                  continue;
               case 17:
                  var16 = com.aspose.cells.b.a.zo.a(var3);
                  continue;
               case 18:
                  var18 = com.aspose.cells.b.a.zo.a(var3);
                  continue;
               case 19:
                  var12 = com.aspose.cells.b.a.zo.a(var3);
                  continue;
               case 20:
                  var13 = com.aspose.cells.b.a.zo.a(var3);
                  continue;
               case 21:
                  var14 = var13;
                  continue;
               case 22:
                  var19 = "true".equals(var3) ? 1 : 0;
                  continue;
               }
            default:
               this.c.a();
            }
         }

         if (var19 != -1) {
            var1.setGridlinesVisible(var19 == 1);
         }

         if (var12 != 0) {
            var1.setPageBreakPreview(true);
            var1.setZoom(var14);
         } else {
            var1.setZoom(var13);
         }

         if (var7 == 0 && var8 == 0) {
            var1.setActiveCell(CellsHelper.cellIndexToName(var6, var5));
            var1.setFirstVisibleRow(var18);
            var1.setFirstVisibleColumn(var15);
         } else {
            boolean var20 = var8 == 1 || var7 == 1;
            var1.a(!var20);
            PaneCollection var21 = var1.b();
            int var22;
            if (var8 == 0) {
               if (var20) {
                  var21.a(var9 * 15, 0, var18, 0);
               } else {
                  var22 = var9 - var15;
                  var21.b(var9, 0, var22, 0);
               }

               var21.f();
               switch(var11) {
               case 2:
                  var21.a((byte)3);
                  break;
               case 3:
                  var21.a((byte)1);
               }
            } else if (var7 == 0) {
               if (var20) {
                  var21.a(0, var10 * 15, 0, var16);
               } else {
                  var22 = var10 - var17 + 1;
                  var21.b(0, var10, 0, var22);
               }

               var21.f();
               switch(var11) {
               case 0:
                  var21.a((byte)3);
                  break;
               case 2:
                  var21.a((byte)2);
               }
            } else {
               if (var20) {
                  var21.a(var9 * 15, var10 * 15, var18, var16);
               } else {
                  var22 = var9 - var15;
                  int var23 = var10 - var17;
                  var21.b(var9, var10, var22, var23);
               }

               var21.f();
               switch(var11) {
               case 0:
                  var21.a((byte)3);
                  break;
               case 1:
                  var21.a((byte)1);
                  break;
               case 2:
                  var21.a((byte)2);
                  break;
               case 3:
                  var21.a((byte)0);
               }
            }

            var1.s().a(CellsHelper.cellIndexToName(var6, var5));
         }

      }
   }

   private void e() throws Exception {
      if (this.c.n()) {
         this.c.a();
      } else {
         String var1 = null;
         String var2 = null;
         if (this.c.m()) {
            while(this.c.l()) {
               switch(d.a(this.c.p().toLowerCase())) {
               case 1:
                  var1 = this.c.s();
                  break;
               case 7:
                  var2 = this.c.s();
               }
            }

            this.c.k();
         }

         String var3 = this.c.i();
         int var6;
         int var13;
         switch(d.a(var1)) {
         case 22:
            boolean var14 = "true".equals(var3);
            if (!var14) {
               for(int var10 = 0; var10 < this.b.getWorksheets().getCount(); ++var10) {
                  this.b.getWorksheets().get(var10).setGridlinesVisible(false);
               }
            }
            break;
         case 23:
            boolean var4 = "true".equals(var3);
            if (!var4) {
               for(int var11 = 0; var11 < this.b.getWorksheets().getCount(); ++var11) {
                  this.b.getWorksheets().get(var11).setDisplayZeros(false);
               }
            }
            break;
         case 24:
            this.b.getSettings().setCalcMode("true".equals(var3) ? 0 : 2);
         case 25:
         case 26:
         case 27:
         case 28:
         default:
            break;
         case 29:
            Worksheet var5 = this.b.getWorksheets().get(var3);
            if (var5 != null) {
               this.b.getWorksheets().setActiveSheetIndex(var5.getIndex());
            }
            break;
         case 30:
            if ("0".equals(var3)) {
               this.b.getSettings().setVScrollBarVisible(false);
            }
            break;
         case 31:
            if ("0".equals(var3)) {
               this.b.getSettings().setHScrollBarVisible(false);
            } else {
               var6 = com.aspose.cells.b.a.zo.a(var3);
               var6 = var6 > 1000 ? 1000 : var6;
               this.b.getSettings().setSheetTabBarWidth(var6);
            }
            break;
         case 32:
            var6 = com.aspose.cells.b.a.zo.a(var3);
            if (var6 != 0) {
               Color var12 = Color.fromArgb(var6);

               for(var13 = 0; var13 < this.b.getWorksheets().getCount(); ++var13) {
                  this.b.getWorksheets().get(var13).a(var12);
               }
            }
            break;
         case 33:
            if (!"true".equals(var3)) {
               this.b.getSettings().setShowTabs(false);
            }
            break;
         case 34:
            boolean var7 = "true".equals(var3);
            if (!var7) {
               for(var13 = 0; var13 < this.b.getWorksheets().getCount(); ++var13) {
                  this.b.getWorksheets().get(var13).setRowColumnHeadersVisible(false);
               }
            }
            break;
         case 35:
            boolean var8 = "true".equals(var3);
            if (!var8) {
               for(int var9 = 0; var9 < this.b.getWorksheets().getCount(); ++var9) {
                  this.b.getWorksheets().get(var9).setOutlineShown(false);
               }
            }
         }

      }
   }
}
